<template>
	<view class="page-view">
		<nav-view :defaultShow="true" :title="''"></nav-view>
		<view class="page-conte">
			<view class="title-h2">
				<image class="icon" src="../../static/images/title-zssc.png" mode=""></image>
			</view>
			<view class="list-view-box">
				<view class="item-box" v-for="(item,index) in list" :key="index" @click="gotoDetail(item)">
					<view class="jb-box">
						<text v-if="item.type_id == 1">问答</text>
						<text v-else>案例</text>
						<img class="bg" :src="item.type_id == 1?require('@/static/images/title-right-bg1.png'):require('@/static/images/title-right-bg2.png')" alt="">
					</view>
					<view class="conte-box">
						<view class="title u-line-3">{{item.article_title}}</view>
						<view class="conte">
							<text>{{item.article_content}}</text>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data(){
			return{
				list:[]
			}
		},
		onShow() {
			this.init();
		},
		methods:{
			init(){
				let self = this;
				self._get('user.index/getCollect', {}, function(res) {
					self.list = res.data.list;
					
				});
			},
			gotoDetail(item){
				if(item.type_id == 1){
					
				} else {
					uni.navigateTo({
						url:'/pages/award/index?case_id=' + item.ext_id
					})
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
	.title-h2 {
		width: 100%;
		padding: 0 40rpx;
	}
	
	.title-h2 .icon {
		width: 239rpx;
		height: 86rpx;
	}
	.list-view-box {
		margin-top: 30rpx;
		padding: 0 40rpx;
	}
	.item-box {
		padding: 40rpx;
		background: #FFFFFF;
		box-shadow: 0rpx 5rpx 20rpx 1rpx rgba(0,26,112,0.08);
		border-radius: 13rpx;
		margin-bottom: 40rpx;
		position: relative;
	}
	.jb-box {
		position: absolute;
		right: 0;
		top: 0;
		z-index: 10;
		width: 155rpx;
		height: 93rpx;
		text-align: center;
		font-size: 29rpx;
		font-family: Source Han Sans CN-Medium, Source Han Sans CN;
		font-weight: 500;
		color: #FFFFFF;
	}
	.jb-box .bg {
		position: absolute;
		left: 0;
		top: 0;
		width: 100%;
		height: 100%;
	}
	.jb-box text {
		position: relative;
		z-index: 10;
		display: block;
		line-height: 65rpx;
		padding-left: 20rpx;
	}
	.conte-box .title {
		font-size: 37rpx;
		font-family: Source Han Sans CN-Medium, Source Han Sans CN;
		font-weight: 500;
		color: #333333;
		margin-top: 20rpx;
	}
	.conte-box .conte {
		margin-top: 20rpx;
		font-size: 32rpx;
		font-family: Source Han Sans CN-Regular, Source Han Sans CN;
		color: #999999;
		overflow: hidden;
		    -webkit-line-clamp: 3;
		    text-overflow: ellipsis;
		    display: -webkit-box;
		    -webkit-box-orient: vertical;
	}
</style>